/*
 * Copyright (C) 2013 The i18nCTS Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.googlecode.i18nCTS.view;

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;

import android.util.Log;

import com.googlecode.i18nCTS.provider.i18nCTSProvider;

public class DateFormatSectionFragment extends AbstractSectionFragment {
	private static final String TAG = "I18nCTS_" + DateFormatSectionFragment.class.getSimpleName();
	public static final String CATEGORY = "DateFormat";

	public DateFormatSectionFragment() {
		Log.d(TAG, "ctr");
	}

	@Override
	public String getCategory() {
		return CATEGORY;
	}
	
	@SuppressWarnings("static-access")
	@Override
	public void buildList(i18nCTSProvider provider) {
		Calendar cal = Calendar.getInstance();
	    cal.set(2012, 5, 7, 9, 1, 4);
	    Date date = new Date(cal.getTimeInMillis());
	    DateFormat df = DateFormat.getInstance();
	    df.setCalendar(cal);
	    
		provider.addData(df.getInstance().format(date), "DateFormat.getInstance()");
		provider.addData(df.getDateInstance().format(date), "DateFormat.getDateInstance()");
		provider.addData(df.getDateInstance(DateFormat.FULL).format(date), "DateFormat.getDateInstance(DateFormat.FULL)");
		provider.addData(df.getDateInstance(DateFormat.LONG).format(date), "DateFormat.getDateInstance(DateFormat.LONG)");
		provider.addData(df.getDateInstance(DateFormat.MEDIUM).format(date), "DateFormat.getDateInstance(DateFormat.MEDIUM)");
		provider.addData(df.getDateInstance(DateFormat.SHORT).format(date), "DateFormat.getDateInstance(DateFormat.SHORT)");
		provider.addData(df.getDateTimeInstance().format(date), "DateFormat.getDateTimeInstance()");
		provider.addData(df.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL).format(date), "DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL)");
		provider.addData(df.getDateTimeInstance(DateFormat.FULL,DateFormat.LONG).format(date), "DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.LONG)");
		provider.addData(df.getDateTimeInstance(DateFormat.FULL,DateFormat.MEDIUM).format(date), "DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.MEDIUM)");
		provider.addData(df.getDateTimeInstance(DateFormat.FULL,DateFormat.SHORT).format(date), "DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.SHORT)");
		provider.addData(df.getDateTimeInstance(DateFormat.LONG,DateFormat.FULL).format(date), "DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.FULL)");
		provider.addData(df.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG).format(date), "DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG)");
		provider.addData(df.getDateTimeInstance(DateFormat.LONG,DateFormat.MEDIUM).format(date), "DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.MEDIUM)");
		provider.addData(df.getDateTimeInstance(DateFormat.LONG,DateFormat.SHORT).format(date), "DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.SHORT)");
		provider.addData(df.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.FULL).format(date), "DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.FULL)");
		provider.addData(df.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.LONG).format(date), "DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.LONG)");
		provider.addData(df.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM).format(date), "DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM)");
		provider.addData(df.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.SHORT).format(date), "DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.SHORT)");
		provider.addData(df.getDateTimeInstance(DateFormat.SHORT,DateFormat.FULL).format(date), "DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.FULL)");
		provider.addData(df.getDateTimeInstance(DateFormat.SHORT,DateFormat.LONG).format(date), "DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.LONG)");
		provider.addData(df.getDateTimeInstance(DateFormat.SHORT,DateFormat.MEDIUM).format(date), "DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.MEDIUM)");
		provider.addData(df.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT).format(date), "DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT)");
		provider.addData(df.getTimeInstance().format(date), "DateFormat.getTimeInstance()");
		provider.addData(df.getTimeInstance(DateFormat.FULL).format(date), "DateFormat.getTimeInstance(DateFormat.FULL)");
		provider.addData(df.getTimeInstance(DateFormat.LONG).format(date), "DateFormat.getTimeInstance(DateFormat.LONG)");
		provider.addData(df.getTimeInstance(DateFormat.MEDIUM).format(date), "DateFormat.getTimeInstance(DateFormat.MEDIUM)");
		provider.addData(df.getTimeInstance(DateFormat.SHORT).format(date), "DateFormat.getTimeInstance(DateFormat.SHORT)");

		provider.addTitle(CATEGORY);
     }
}